package com.higgins.eventtracking.server.dataModel;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.higgins.eventtracking.client.dto.BodyStatsDTO;
import com.higgins.eventtracking.client.dto.HealthEventDTO;
import com.higgins.eventtracking.client.dto.QuestionDTO;

@PersistenceCapable
public class Question {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Date timestamp;
	
	@Persistent
	private String category;
	
	@Persistent
	private String question;
	
	@Persistent
	private String answer;
	
	@Persistent
	private String falseAnswerOne;

	@Persistent
	private String falseAnswerTwo;

	@Persistent
	private String falseAnswerThree;

	@Persistent
	private String falseAnswerFour;

	public Question(QuestionDTO dto)	{
		this.timestamp = dto.getTimestamp();
		this.category = dto.getCategory();
		this.question = dto.getQuestion();
		this.answer = dto.getAnswer();
		this.falseAnswerOne = dto.getFalseAnswerOne();
		this.falseAnswerTwo = dto.getFalseAnswerTwo();
		this.falseAnswerThree = dto.getFalseAnswerThree();
		this.falseAnswerFour = dto.getFalseAnswerFour();
	}
	public Question()	{
		
	}
	public void setTimestamp(Date timestamp)	{
		this.timestamp = timestamp;
	}
	public Date getTimestamp()	{
		return timestamp;
	}
	public void setCategory(String category)	{
		this.category = category;
	}
	public String getCategory()	{
		return category;
	}
	public void setQuestion(String question)	{
		this.question = question;
	}
	public String getQuestion()	{
		return question;
	}
	public void setAnswer(String answer)	{
		this.answer = answer;
	}
	public String getAnswer()	{
		return answer;
	}
	public void setFalseAnswerOne(String falseAnswerOne)	{
		this.falseAnswerOne = falseAnswerOne;
	}
	public String getFalseAnswerOne()	{
		return falseAnswerOne;
	}	
	public void setFalseAnswerTwo(String falseAnswerTwo)	{
		this.falseAnswerTwo = falseAnswerTwo;
	}
	public String getFalseAnswerTwo()	{
		return falseAnswerTwo;
	}
	public void setFalseAnswerThree(String falseAnswerThree)	{
		this.falseAnswerThree = falseAnswerThree;
	}
	public String getFalseAnswerThree()	{
		return falseAnswerThree;
	}
	public void setFalseAnswerFour(String falseAnswerFour)	{
		this.falseAnswerFour = falseAnswerFour;
	}
	public String getFalseAnswerFour()	{
		return falseAnswerFour;
	}
	public QuestionDTO toQuestionDTO()	{
		return new QuestionDTO(timestamp, category, question, answer, falseAnswerOne, falseAnswerTwo, falseAnswerThree, falseAnswerFour);
	}
}
